/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejercicios.pkg1evaluacion;

/**
 *
 * @author Admin
 */
public class calcularSuma 
{
  public static int sumarDigitos (int codigo)
    {
        int sumaDigitos=0;
        int resto;
        int code=codigo;
        
        while(code!=0)
          {
              resto=code%10;
              sumaDigitos=sumaDigitos+resto;
              code=code/10;     
          }
                  
        return sumaDigitos;
    }   
}
